<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<meta name="decorator" content="sysDefault"/>
<script type="text/javascript"> 
$(document).ready(function() { 
	var old_versionId=${version.versionId}; 
	var old_assistId=${version.assistId}; 
	var versionId=${version.versionId}+1;
	var assistId=${version.assistId}+1;  
	
	$("#versionId_new").html(versionId+"."+"0"); 
    $("#RadioVersionId").val(versionId+"."+"0"); 
  
    $("#assistId_new").html(old_versionId+"."+assistId); 
    $("#RadioAssistId").val(old_versionId+"."+assistId);  
});

function btn_click(){
	var str = $("input[name='versionId']:checked").val();
	if(str==null ||str==""){
		return;  
	} 
  document.all("form").setAttribute("action", "${contextPath}/${version.versionUrl}/${version.id}/${version.historyId}/createNewVersion?assistId="+str); 
  document.all("form").submit();  
}
</script>
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<div class="panel panel-default">
				  <div class="panel-heading">
				    <h3 class="panel-title">
				    	版本信息
						<a class="btn btn-default btn-sm pull-right" role="button" href="javascript:void(0)" onclick="history.go(-1)">返回</a>
				    </h3>
				  </div>
				  <form class="form-signin" role="form" action=""  id="form" method="post">
				  	<table class="table table-bordered">
					  <tbody>
					  	<tr>
					  		<td class="text-right" style="width: 20%"><strong>请选择版本号</strong></td>
					  		<td> 
					  			<input type="radio" name="versionId" value="" id="RadioVersionId" />  <span id="versionId_new"></span>
					  		    <input type="radio" name="versionId" value="" id="RadioAssistId"/>  <span id="assistId_new"></span> 
					  		</td>
					  	</tr>
					   <tr>
					  		<td class="text-right" style="width: 20%"></td>
					  		<td><strong>此操作是创建一个新版本的文档，请谨慎使用!</strong></td>
					  	</tr>
					  	<tr>
					  		<td class="text-right" style="width: 20%"></td>
					  		<td>  
				  			  <input class="btn btn-primary" type="button" value="下一步" onclick="btn_click()"/>
				  			 <input class="btn btn-default" type="button" value="返 回" onclick="history.go(-1)"/>
					  		</td>
					  	</tr> 
					  </tbody>
					</table>
					</form>
				  <div class="panel-footer"></div>
				</div>			
			</div>
		</div>
	</div>
</body>
</html>